package net.stratusprogramming.school.Game.Screens;

import net.stratusprogramming.school.Game.Framework.Screen;
import net.stratusprogramming.school.Game.Framework.System.Config;
import net.stratusprogramming.school.Game.Framework.System.InstanceMgr;

import org.newdawn.slick.Color;
import org.newdawn.slick.Graphics;
import org.newdawn.slick.Image;
import org.newdawn.slick.Input;
import org.newdawn.slick.SlickException;

public class WinnerScreen extends Screen {

	/** Slick2d input */
	private Input input;
	
	/** Image to draw */
	private Image image;
	
	/**
	 * Creates/loads the background
	 */
	public WinnerScreen() {
		input = InstanceMgr.input;
		try {
			image = new Image("res/images/battle/winner.jpg");
		} catch (SlickException e) { }
	}
	
	@Override
	public void update(int delta) {
		if(input.isKeyPressed(Input.KEY_SPACE) || input.isKeyPressed(Input.KEY_ENTER)) {
			InstanceMgr.main.setScreen(InstanceMgr.world);
		}		
	}

	@Override
	public void render(Graphics g) {
		g.drawString("", 0, 0); // fix weird glitch
		image.draw((Config.WINDOW_WIDTH-image.getWidth())/2, (Config.WINDOW_HEIGHT-image.getHeight())/2);
	}
}

